$.ajax({
    type: 'get',
    url: '/slides',
    success: function(response) {
        var html = template('slidesTpl', { data: response });
        $('#slidesBox').html(html);
        var swiper = new Swiper('.swiper-container', {
            loop: true,
            navigation: {
                nextEl: '.swiper-button-next',
                prevEl: '.swiper-button-prev'
            },
            pagination: {
                el: '.swiper-pagination'
            }
        });
    }
});

$.ajax({
    type: 'get',
    url: '/posts/lasted',
    success: function(response) {
        var html = template('lastedTpl', { data: response });
        $('#lastedBox').html(html);
    }
});
